import request from '@/utils/request'
import qs from 'qs';

// 查询数据库组列表
export function queryGroupListByPage(query) {
  return request({
    url: '/datascan/b/dbgroup/queryDbGroupList',
    method: 'get',
    params: query
  })
}

// 查询数据库组列表
export function queryGroupList(params) {
  return request({
    url: '/datascan/b/dbgroup/queryList',
    method: 'get',
    params
  })
}

// 新增数据库组
export function queryGroupInfo(query) {
  return request({
    url: '/datascan/b/dbgroup/query',
    method: 'get',
    params: query
  })
}


// 新增数据库组
export function addGroup(data) {
  return request({
    url: '/datascan/b/dbgroup/addDbGroup',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}

// 新增数据库组
export function updateGroup(data) {
  return request({
    url: '/datascan/b/dbgroup/updateDbGroup',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}

// 新增数据库组
export function deleteGroup(data) {
  return request({
    url: '/datascan/b/dbgroup/delete',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}

// 新增数据库组
export function deleteGroupForCheck(data) {
  return request({
    url: '/datascan/b/dbgroup/isDelete',
    method: 'post',
    headers: {
      "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
    },
    data: qs.stringify(data)
  })
}


// 获取数据库列表
export function queryDbNameList(params) {
  return request({
    url: '/datascan/b/dbgroup/queryDbNameList',
    method: 'get'
  })
}

// 获取管理员用户
export function queryUserList(params) {
  return request({
    url: '/datascan/b/dbgroup/queryUserList',
    method: 'get'
  })
}


